#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
void month_day(int year, int yearday, int* pmonth, int* pday)
{
	int a[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31,30,31 };
	int i, sum = 0;
	if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
		a[2] = 29;
	for (i = 0; i <= 12; i++)
	{
		sum += a[i];
		if (sum >= yearday)
			break;
	}
		*pmonth = i;
		*pday = yearday - (sum - a[i]);
	printf("%d-%d-%d", year, *pmonth, *pday);

}
int main()
{
	printf("Input year and yearday:");
	int year, yearday;
	scanf("%d%d", &year, &yearday);
	int month, day;
	month_day(year, yearday, &month, &day);
	return 0;
}